package com.core.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.core.dao.GenericDao;
import com.core.dao.PrestasiSekolahDao;
import com.core.entity.PrestasiSekolah;
import com.core.entity.Sekolah;
import com.core.service.PrestasiSekolahService;

@Service
public class PrestasiSekolahServiceImpl extends
		GenericServiceImpl<PrestasiSekolah, Long> implements
		PrestasiSekolahService, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6550442169945243421L;
	@Autowired
	private PrestasiSekolahDao prestasiSekolahDao;

	@Override
	public GenericDao<PrestasiSekolah, Long> getDao() {
		return prestasiSekolahDao;
	}

	@Override
	public List<PrestasiSekolah> prestasiSekolah(Sekolah sekolah) {
		if (sekolah.getId() != null)
			return findAllByProperty("sekolah", sekolah);
		else
			return null;
	}

}
